package com.job51.hro.datacheckservice.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.job51.common.spring.boot.datasource.annotation.DataSource;
import com.job51.common.spring.boot.datasource.annotation.IDataSource;
import com.job51.hro.datacheckservice.dto.MailSendAndStatus;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DataSource("qmaillogdb")
public interface MailsendMapper extends IDataSource, BaseMapper<MailSendAndStatus> {
    @Select("select a.host,a.rundate,a.runtime,concat(a.mailuser,'@',a.maildomain) as mail,a.flag,b.status,b.failcode as total \n" +
            "\tfrom mailsend${date} a ,mailstatus${date}  b \n" +
            "\twhere a.id=b.id and a.host=b.host and b.status='failure' and a.flag like 'TIAOJI_%'")
    List<MailSendAndStatus> selectMailAndStatus(String date);

}